package jobs;

import java.util.HashMap;
import java.util.Map;

import creatures.Gear;

import spells.*;

import main.*;

/*
 * A class that provides the basic framework for a job
 */

public abstract class Job {
	public String name;//class name
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Weapon jobWeapon;
	public Gear armor;

	Map<Integer, Spell> spells=new HashMap<Integer, Spell>();//map linking each spell to a level
	//changes for leveling up
	public int strChange;
	public int stamChange;
	public int intChange;
	public int spChange;
	
	//starting stats
	public int startStr;
	public int startStam;
	public int startInt;
	public int startSp;
	
//	int healthChange;
	//int manaChange;
	
	public Job(String n){
		name=n;
		jobWeapon=new Weapon();
		armor=new Gear();
	}//end constructor
	
	public void grantSpell(Player p){
		Spell sp=spells.get(p.level);
		if(sp!=null){
			if(p.findSpell(sp.getName())!=null)
				p.addSpell(sp);
		}//end if
	}//end method
	
	public String toString(){
		return name;
	}//end method
}//end class
